let T = {
    value: 1,
    left: {
        value: 1,
        left: null,
        right: null
    },
    right: {
        value: 1,
        left: null,
        right: null
    }
}

function isBalanceTree(T) {
    return isBalance(T, T)
}

function isBalance(L, R) {
    if (!L && !R) return true
    if (!L || !R) return false
    if (L.value !== R.value) return false
    return isBalance(L.left, R.right) && isBalance(L.right, R.left)

}

console.log(isBalanceTree(T));
